#include <cstdio>

int main( )
{
    __int64 f[ 61 ];
    int i, t, n, m;
    f[ 0 ] = 1;
    for ( i = 1; i <= 60; i++ ) f[ i ] = f[ i - 1 ] * 2;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d", &n, &m);
        printf("%I64d\n", f[ n - m ]);
    }
    return 0;
}
